package com.chuangshixinchen.enterprise.schedule;

import com.chuangshixinchen.enterprise.common.DateUtil;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.util.unit.DataUnit;

import java.util.Date;

import static com.chuangshixinchen.enterprise.common.FileZip.ZipFolder;

@Component
public class ScheduledTask {

//    @Scheduled(cron = "0/5 * * * * ?")
//    public void taskTest(){
//        processService.expireNotice();
//    }

    //在每天的8:00，执行方法，对快到期的督办任务进行推送提醒通知
    @Scheduled(cron = "0 55 23 * * ?")
//    @Scheduled(cron = "0 * * * * ?")
    public void taskPerDay(){
        try {
            String yyyyMMdd = DateUtil.timeToString(new Date(), "yyyyMMdd");
            ZipFolder("D:\\huangtao\\images\\"+yyyyMMdd, "zip");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
